package schoolDemo3;

import java.util.Scanner;

public class MaxAndMin {
    public static void main(String[] args) {
        int a;
        int b;
        int c;
        Scanner reader=new Scanner(System.in);
        System.out.println("请输入三个元素的对应的值：");
        a= reader.nextInt();
        b= reader.nextInt();
        c= reader.nextInt();
        int max=(a>b)?a:b;
        if(max>c) System.out.println("max="+max);
        else System.out.println("max="+c);

        int min;
        if(a<b&&a<c) System.out.println("min="+a);
        else if(b<a&&b<c) System.out.println("min="+b);
        else if (c<a&c<b) System.out.println("min="+c);
    }
}
